package com.lhn.service.impl;

import com.lhn.entity.User;
import com.lhn.mapper.UserMapper;
import com.lhn.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author lhn
 * @date 2024-10-11 23:05
 */

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<User> findAll(int index, int limit) {
        return userMapper.findAll(index, limit);
    }

    @Override
    public User findById(long id) {
        return userMapper.findById(id);
    }

    @Override
    public int count() {
        return userMapper.count();
    }

    @Override
    public void deleteById(long id) {
        userMapper.deleteById(id);
    }

    @Override
    public void save(User user) {
        userMapper.save(user);
    }

    @Override
    public void update(User user) {
        userMapper.update(user);
    }
}
